<%-- 
    Document   : RelacaoBairro
    Created on : 21/06/2013, 19:14:06
    Author     : Daniel
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="br.com.fametro.model.dao.BairroDao"%>
<%@page import="br.com.fametro.model.bean.Bairro"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
<%
List<Bairro> listBairro = new ArrayList<Bairro>();
BairroDao bairroDao = new BairroDao();
String nome = request.getParameter("txtnome");
%>
<table border="1">
<thead>
<tr>
<th>Codigo</th>
<th>Nome</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<%listBairro = bairroDao.listar();
for(Bairro b: listBairro) {
%>
<tr>
<td><%= b.getCodigo()%></td>
<td><%= b.getDescrBairro()%></td>
    <td>
<input type="button" value="Alterar" name="btAlterar" onclick="location='AlterarBairro.jsp?codigo=<%=
b.getCodigo()%>'"/>
<input type="button" value="Excluir" name="btExcluir" onclick="location='ExcluirBairro.jsp?codigo=<%=
b.getCodigo()%>'"/>
</td>
</tr>
<%
}
%>
</tbody>
</table>
</body>
</html>
